package com.shroo8.footballblog.controllers.api;

import java.util.Locale;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.shroo8.footballblog.bo.api.DeleteArticleBo;

@Controller
public class DeleteArticleController {
	private static final Logger logger = LoggerFactory.getLogger(DeleteArticleController.class);

	@Resource(name="deleteArticleBo", type=com.shroo8.footballblog.bo.api.DeleteArticleBoImpl.class)
	private DeleteArticleBo deleteArticleBo;
	
	@RequestMapping(value = "/articles/{articleId}", method = RequestMethod.DELETE)
	public @ResponseBody String deleteArticle(Locale locale, @PathVariable("articleId") String articleId) {
		logger.info("Welcome to deleteArticle! The client locale is {}.", locale);
		logger.info("article id is:" + articleId);
		
		deleteArticleBo.deleteArticle(articleId);
		return "";
	}

}
